﻿using VideoSeller.Business.Models;
using VideoSeller.Core.Configuration;

namespace VideoSeller.Web.Models
{
	public class LoginViewModel : BaseViewModel
	{
		public string Login { get; set; }

		public string Password { get; set; }

		public string UsdToVsl { get; set; }

		public LoginViewModel()
		{
            try
            {
                if (CurrentMembershipUser.IsAnonymous == false && CurrentMembershipUser.Client == null)
                {
                    var clientModel = IoC.Resolve<ClientModel>();
                    Business.Data.Client c = clientModel.RegisterClientVisell(CurrentMembershipUser);
                    CurrentMembershipUser.Client = c;

                }
            }
            catch
            {
            }
			var settings = IoC.Resolve<SettingsModel>();
            UsdToVsl = "";//vladimir settings.GetSetting("UsdToVsl").Description;
		}
	}
}